package com.sgl.support;


import com.sgl.entity.User;

public class ThreadLocalUser {
	private ThreadLocal<User> users;
	
	private ThreadLocalUser() {
		users = new ThreadLocal<User>();
	}

	public User getUser() {
		return users.get();
	}

	public void setUser(User user) {
	    users.set(user);
	}
	
	public void remove() {
	    users.remove();
	}
	
	private static ThreadLocalUser threadLocalUser = new ThreadLocalUser();
	
	public static ThreadLocalUser getInstance() {
		return threadLocalUser;
	}
}
